RFC: Use AssertionError when inside decorated test case#12
RFC: Use AssertionError when inside decorated test case#12
AssertionError when inside decorated test case#12Conversation
- Stops at first failure like most other test frameworks - Single test passed message regardless of the number of assertions - Discourage fat test cases - Allow using external assertions - `np.testing.assert_equal` - `pd.testing.assert_frame_equal` - assertion packages
| try: | ||
| func() | ||
| if is_test_case: | ||
| display("PASSED", "Test Passed") |
There was a problem hiding this comment.
This will show extra <PASSED::> if any assertion functions were used inside some wrapper.
AssertionError when inside decorated test caseAssertionError when inside decorated test case
Are you interested in feedback on the design, code/style, both, or some other aspect(s)? |
|
Any feedback. But I'm honestly starting to think it's better to spend time on figuring out how to allow kata authors to choose |
|
I'm curious what the rationale is behind limiting the |
I'm not sure what you mean by So old tests not using decorators looks like this: test.it("old test")
test.assert_equals(1, 2)If this |
|
Maybe "handle" is a better term. No particular line--the design seems based on |
|
That comment means import codewars_test as test
@test.describe("group 1")
def group_1():
@test.it("test 1")
def test_1():
test.assert_equals(1, 2)works, but import codewars_test as test
def wrapped_equal(a, b):
test.assert_equal(a, b)
@test.describe("group 1")
def group_1():
@test.it("test 1")
def test_1():
wrapped_equal(1, 2)doesn't because of the way it currently checks if it's inside a test case. We can make it work better, but I didn't think it's worth it for RFC.
We can do that if we didn't have to worry about the existing tests using assertions from this package ( |
|
Also, to be clear, that limitation only applies for assertions from this package. Anything that throws |
np.testing.assert_equalpd.testing.assert_frame_equalTests written in old style are not affected.
Need some review and feedback.
Closes #9